home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2968 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: san-jose.netgen.com!erichard
  2. From: Eric Richard <erichard@netgen.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: GCC and Default Constructors
  5. Date: Sat, 20 Jan 1996 17:29:29 -0500
  6. Organization: net.Genesis Corp.
  7. Message-ID: <Pine.LNX.3.91.960120172645.1558N-100000@san-jose.netgen.com>
  8. NNTP-Posting-Host: san-jose.netgen.com
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11.  
  12.    I just spent about 3 days intermittently trying to solve a problem that
  13. I finally figured out and I was trying to see if there is something 
  14. I can do to avoid a similar situation.
  15.  
  16.     Basically my problem stemmed from a typo on my part and the fact
  17. that C++ will automatically provide a default constructor for you if
  18. you don't provide one.  To make a long story short, I had a class
  19. named 'QueryTable' and had defined a constructor 'queryTable::QueryTable'.
  20. Now obviously this is wrong, but what was screwing me up was that no
  21. error was being generated because G++ was happily providing me with
  22. a default constructor for my class.
  23.  
  24.    So, my question is this:  Does anybody know if there is some way
  25. of at least getting G++ to warn you if it is using a default constructor?
  26. If I had that, I would've been able to figure this out much more quickly.
  27.  
  28.                                     -Eric Richard
  29.  
  30. Eric Richard ----------------------------------- voice: (617) 577-9800
  31. net.Genesis                                        fax: (617) 577-9850
  32. 68 Rogers St                                       erichard@netgen.com 
  33. Cambridge, MA 02142 --------------------------- http://www.netgen.com/
  34.  
  35.  
  36.